{template Public:Page:header}
<div class="container">
    
<div class="row">
     
    <div class="row">
      <div class="col-lg-9">
        <div class="well" style="background:#FFF">
        
        
        <div class="row">
              <div class="col-lg-12 col-sm-12 col-xs-12">
                <div class="wizard wizard-wired">
                  <ul class="steps">
                    <li class="active" data-target="#wiredstep1"><span class="step">1</span><span class="title">填写服务信息</span> <span class="chevron"></span></li>
                    <li data-target="#wiredstep2"><span class="step">2</span><span class="title">发布审核</span> <span class="chevron"></span></li>
                  </ul>
                </div>
              </div>
        </div>
    
    	<br />
		<div class="row"> 
		<div class="col-lg-11 col-lg-offset-1"> 
          {template Fuwu:Publish:form}
        </div>
        </div>
        
        
        <script src="{echo AURL}/js/validation/bootstrapValidator.js"></script>
        <script src="{echo AURL}/js/datetime/bootstrap-datepicker-{echo C('DEFAULT_LANG')}.js"></script>
        <script>							
        $(function(){
            
                     var um = UM.getEditor('Content');
                     
                     um.addListener("contentChange",function(){
                        if(UM.getEditor('Content').hasContents()){
                            $('#FuwuForm button[type="submit"]').attr('disabled',false);
                        }
                     });
                      
                     $("#FuwuCategory").click( function () { $('#FuwuForm button[type="submit"]').attr('disabled',false); }); 
                        
                    //分类
                  SetFormCategory(AURL+"/js/foxphp_json_fuwu_category.js",'#FuwuCategory');
        
                  $('#FuwuForm').bootstrapValidator({
                        excluded: [':disabled'],
                        feedbackIcons: {
                            valid: 'glyphicon glyphicon-ok',
                            invalid: 'glyphicon glyphicon-remove',
                            validating: 'glyphicon glyphicon-refresh'
                        },
                        fields: {
                            subject: {
                                validators: {
                                    notEmpty: {
                                        message: '服务标题不能为空！'
                                    },
                                    stringLength: {
                                        min: 5,
                                        max: 100,
                                        message: '标题最少5个字到100字内！'
                                    }
                                }
                            },
                            money: {
                                validators: {
                                    notEmpty: {
                                        message: '报价不能为空！'
                                    },
                                    regexp: {
                                        regexp: /^[0-9]+$/,
                                        message: '报价格式有误！'
                                    }
                                }
                            },
                            endtime: {
                                validators: {
                                    notEmpty: {
                                        message: '周期不能为空！'
                                    },
                                    regexp: {
                                        regexp: /^[0-9]+$/,
                                        message: '周期格式有误！'
                                    }
                                }
                            }
                            
                        },
                        submitHandler: function (form) {
                            
                            var catid=$("#Catid").val();
                            if(catid<1){
                                 bootbox.alert({ 
                                    size: 'small',
                                    message: "请选择服务分类！"
                                })
                                 return false; 
                             }
                                             
                         if(!UM.getEditor('Content').hasContents()){
                             bootbox.alert({ 
                                size: 'small',
                                message: "请填写服务需求！"
                             })
                             return false; 
                         }
                                             
                          var postaction=$('input[name="id"]').val() > 0 ? 'publishedit' : 'publishinsert';
        
                          $.post('{echo U("/post/fuwu")}/'+postaction,$("#FuwuForm").serialize(), function(json) {
                            
                                $('.bootbox').PhpappProgress({json:json});
        
                                return true;
                            
                          }, 'json');
                          
        
                         bootbox.dialog({
                             message: '<div class="progress progress-striped active"><div style="width: 1%" aria-valuemax="100" aria-valuemin="0" aria-valuenow="20" role="progressbar" class="progress-bar progress-bar-info"><span>0%</span></div></div>',
                             title: '<i class="icon fa fa-retweet"></i> 提交中',
                             closeButton: false
                         }).PhpappProgress({time:2000});
                     
                          return false; 
                         
                        } 
                    
                    }) 
        
                });
               
        
        </script>

        </div>
      </div>
      <div class="col-lg-3">
        <div class="well" style="background:#FFF">
  
          <h3 class="text-success">联系客服帮您发需求</h3>
          <h4>客服电话 400-000-000 </h4>
          <p class="label label-default">周一至周日9:00-23:00</p>
          <p>联系在线客服</p>
          <p class="label label-default">周一至周五9:00-18:00</p>
   
        </div>
      </div>
    </div>

</div>
</div>


{template Public:Page:footer}